<?php
# $Id: default_index.tmpl.php,v 1.3 2006/06/22 14:45:39 diegor Exp $


require('header.php');
$auth = $user->getAttribute('auth');
$stats = $template['stats'];
$posts = $template['posts'];
$logged = $template['logged'];
?>
<script language="javascript">
function submitthis()
{
    document.adminForm.submit();
}

function stopkannel()
{
alert("dfasdf");
<?php echo exec('sudo /etc/init.d/kannel stop');?>
}
</script>
<body>
<form action="?module=<?=DEFAULT_MODULE?>&action=DefaultIndex" method="post" name="adminForm">
<table width="100%" class="menubar" cellpadding="0" cellspacing="0" border="0">
    <tr>
        <td class="menudottedline" width="40%">
            <div class="pathway"><font size="2px" color="#000033"><b><?=$config['version']?></b></font></div>       
        </td>
        <td class="menudottedline" align="right">
            <table cellpadding="0" cellspacing="0" border="0" id="toolbar">
                <tr height="60" valign="middle" align="center">
                    <td>
                        <a class="toolbar" href="#">
                        <img src="<?=WEB_MODULE_DIR?>images/help_f2.png" 
                             align="middle" name="new" border="0"><br>Help
                        </a>
                    </td>
                </tr>
            </table>
        </td>
    </tr>
</table>
<br>
<br>
<div align="center" class="centermain">
    <div class="main">
        <table class="adminheading">
            <tr>
                <th class="cpanel" rowspan="2" nowrap>Maintenance&nbsp;<font size="1px" color="#CCCCCC">[<?=strtoupper($auth['privilege'])?>]</font></th>
            </tr>
        </table>

        <table class="adminform">
            <tr>
                <!-- SYSTEM SHORTCUTS  -->
                <td width="50%" valign="top">
                    <div id="cpanel">
                        <div style="float: left">
                            <div class="icon">
                                <a class="toolbar" href="?module=<?=DEFAULT_MODULE?>&action=DefaultIndex">
                               <!-- <a class="toolbar" href="javascript: document.getElementById('flag').value='new'; submitthis();">-->
                                <img src="<?=WEB_MODULE_DIR?>images/frontpage.png" 
                                     align="middle" name="new" border="0"><br>Main
                                </a>
                            </div>
                        </div>
                        <div style="float: left">
                            <div class="icon">
                                <a class="toolbar" href="?module=<?=DEFAULT_MODULE?>&action=AddUser">
                               <!-- <a class="toolbar" href="javascript: document.getElementById('flag').value='new'; submitthis();">-->
                                <img src="<?=WEB_MODULE_DIR?>images/user.png" 
                                     align="middle" name="new" border="0"><br>User Management
                                </a>
                            </div>
                        </div>
                        <!--<div style="float: left">
                            <div class="icon">
                                <a class="toolbar" href="?module=<?=DEFAULT_MODULE?>&action=Lookup">
                               <a class="toolbar" href="javascript: document.getElementById('flag').value='enroll'; submitthis();">
                                <img src="<?=WEB_MODULE_DIR?>images/searchtext.png" 
                                     align="middle" name="new" border="0"><br>Lookups
                                </a>
                            </div>
                        </div>-->
                        <div style="float: left">
                            <div class="icon">
                                <a class="toolbar" href="?module=<?=DEFAULT_MODULE?>&action=TimeSettings">
                                <img src="<?=WEB_MODULE_DIR?>images/systeminfo.png" 
                                     align="middle" name="new" border="0"><br>Time Settings
                                </a>
                            </div>
                        </div>
                        <div style="float: left">
                            <div class="icon">
                                <a class="toolbar" href="?module=<?=DEFAULT_MODULE?>&action=DTRSendConfig">
                                <img src="<?=WEB_MODULE_DIR?>images/categories.png" 
                                     align="middle" name="new" border="0"><br>DTR Sending Configuration
                                </a>
                            </div>
                        </div>
                        <div style="float: left">
                            <div class="icon">
                                <a class="toolbar" href="?module=<?=DEFAULT_MODULE?>&action=GroupManagement">
                                <img src="<?=WEB_MODULE_DIR?>images/addedit.png" 
                                     align="middle" name="new" border="0"><br>Group Management
                                </a>
                            </div>
                        </div>
                        <div style="float: left">
                            <div class="icon">
                                <a class="toolbar" href="?module=<?=DEFAULT_MODULE?>&action=Inquiry">
                               <!-- <a class="toolbar" href="javascript: document.getElementById('flag').value='new'; submitthis();">-->
                                <img src="<?=WEB_MODULE_DIR?>images/user.png" 
                                     align="middle" name="new" border="0"><br>Balance Inquiry
                                </a>
                            </div>
                        </div>
                       <!-- <div style="float: left">
                            <div class="icon">
                                <a class="toolbar" href="?module=<?=DEFAULT_MODULE?>&action=OtherCharge">
                                <img src="<?=WEB_MODULE_DIR?>images/categories.png" 
                                     align="middle" name="new" border="0"><br>Other Charges
                                </a>
                            </div>
                        </div>
                        <div style="float: left">
                            <div class="icon">
                                <a class="toolbar" href="?module=<?=DEFAULT_MODULE?>&action=Terms">
                                <img src="<?=WEB_MODULE_DIR?>images/config.png" 
                                     align="middle" name="new" border="0"><br>Terms
                                </a>
                            </div>
                        </div>
                        <div style="float: left">
                            <div class="icon">
                                <a class="toolbar" href="?module=<?=DEFAULT_MODULE?>&action=ORNumbers">
                                <img src="<?=WEB_MODULE_DIR?>images/systeminfo.png" 
                                     align="middle" name="new" border="0"><br>OR Assignment
                                </a>
                            </div>
                        </div>-->
                    </div>
                    <input type="hidden" id="flag" name="flag" value="">
                </td>
                <!-- BOARDS AND ANNOUNCEMENTS  -->
                <td width="50%" valign="top">
                    <div class="tab-page" id="modules-cpanel">
                        <script type="text/javascript">
                            var tabPane1 = new WebFXTabPane( document.getElementById( "modules-cpanel" ), 1 )
                        </script>

                        <div class="tab-page" id="tab1ElementId">
                            <h2 class="tab">Bulletin</h2>
                            <script type="text/javascript">
                                tabPane1.addTabPage( document.getElementById( "tab1ElementId" ) );
                            </script>

                            <!-- List of Enrolled Student -->
                            <table class="adminlist">
                                <tr>
                                    <th colspan="22">List of Enrolled Student</th>
                                </tr>
                            </table>
                        </div> 
                        <div class="tab-page" id="tab1ElementId">
                            <h2 class="tab">Logged</h2>
                            <script type="text/javascript">
                                tabPane1.addTabPage( document.getElementById( "tab1ElementId" ) );
                            </script>

                            <!-- CURRENTLY LOGGED IN USERS -->
                            <table class="adminlist">
                                <tr>
                                    <th colspan="22">Currently Logged In Users</th>
                                </tr>
                            <?php
                             if ($logged)
                                foreach ($logged as $id => $log) {
                                    $color = ($id/2 == round($id/2)) ? "row0" : "row1";
                             ?>
                                <tr class="<?=$color?>">
                                    <td width="30%"><?= $log['login'];?></td>
                                    <td align="center"><?= $log['privilege'];?></td>
                                </tr>
                            <?php
                             }else{
                             ?>
                                <tr>
                                    <td colspan="2">No online users</td>
                                </tr>
                            <?php
                             }
                             ?>
                            </table>
                        </div>
                    </div>
                </td>
            </tr>
        </table>
    </div>
</div>
<?php require('footer.php'); ?>
